//
//  FJPopularViewController.swift
//  FruitJuice
//
//  Created by Rui on 2024/1/7.
//

import UIKit

class FJPopularViewController: FJBaseViewController {

    private let backButton          = c_make_ex(UIButton.self)
        .image("FJ_Profile_back").end()
    private let pushButton          = c_make_ex(UIButton.self)
        .image("FJ_Home_Popular_push").end()
    private let titleLabel          = c_make_ex(UILabel.self)
        .text("Popular Science").color(.black)
        .font(23.font_wide).end()
    
    override func viewDidLoad() {
        super.viewDidLoad()

        view.subviews{
            backButton
            pushButton
            titleLabel
        }
        
        backButton.top(.statusHeight + 7).leading(15).size(30)
        pushButton.trailing(15).size(45)
        pushButton.CenterY == backButton.CenterY
        titleLabel.leading(15)
        titleLabel.Top == pushButton.Bottom + 5
        
        backButton.addTarget(self, action: #selector(clickBackButton), for: .touchUpInside)
        pushButton.addTarget(self, action: #selector(clickPushButton), for: .touchUpInside)
    }
    
    @objc private func clickBackButton(){
        self.navigationController?.popViewController(animated: true)
    }
    @objc private func clickPushButton(){
        self.navigationController?.pushViewController(FJPopularPushViewController(), animated: true)
    }
}
